import Axios from '../../lib/request'

//获取商品接口
export const getGoodsList = function (data) {
    return Axios.post('/tbSpu/list', data)
}

//上下架操作
export const updateSaleable = function (data) {
    return Axios.post('/tbSpu/update', data)
}

//获取商品详情
export const getGoodsDetail = function (params) {
    return Axios.get(`/tbSpu/getSpuDetail`, { params: params })
}

//添加分类
export const addCategory = function (data) {
    return Axios.post('/category/add', data)
}

//编辑分类
export const updateCategory = function (data) {
    return Axios.put('/category/update', data)
}

//删除分类
export const deleteCategory = function (data) {
    return Axios.get('/category/delete', { params: data })
}

//获取运费集合
export const getPostageLis = function (data) {
    return Axios.get('/tbPostage/getPostageList', { params: data })

}

//添加商品
export const addGoods = function (data) {
    return Axios.post('/tbSpu/addItem', data)
}

//修改商品
export const updateGoods = function (data) {
    return Axios.post('/tbSpu/updateSpu', data)

}
//获取地区
export const getAllArea = function () {
    return Axios.get(`/tbArea/list?id=1`)
}

//商品代理设置列表 
export const getSpuidRebateRules = function(data) {
    return Axios.post("/tRebaterules/getSpuidRebateRules", data);
}

//新增代理规则
export const tRebaterulesAdd = function (data) {
    return Axios.post('/tRebaterules/add', data)
}

//修改代理规则
export const tRebaterulesUpdate = function (data) {
    return Axios.post('/tRebaterules/update', data)
}

//删除代理规则
export const tRebaterulesDelete = function (id) {
    return Axios.get(`/tRebaterules/delete/${id}`)
}
//删除商盟活动规则
export const tbSpuDelect = function (id) {
    return Axios.get(`/tbSpu/delect?spuId=${id}`)
}

//商盟一级类目
export const tbSpuCategoryList = function () {
    return Axios.get(`/tbSpu/categoryList`)
}

//商盟二级类目
export const tbSpuCategoryListScond = function (id) {
    return Axios.get(`/tbSpu/categoryList?id=${id}`)
}

//商盟商品类目
export const tbSpuGetGoodsList = function (id) {
    return Axios.get(`/tbSpu/getGoodsList?id=${id}`)
}

//运费模板
export const freightTemplateList = function () {
    return Axios.get(`/freightTemplate/list`)
}

//下载商盟商品
export const tbSpuAddGoods = function (data) {
    return Axios.post('/tbSpu/addGoods', data)
}

//上传商盟商品
export const tbSpuUploadGoods = function (data) {
    return Axios.post(`/tbSpu/uploadGoods`,data)
}
//取消上传
export const tbSpuSoldOut = function (id) {
    return Axios.get(`/tbSpu/soldOut?spuId=${id}`)
}

//礼品列表
export const tzGiftSelectTzGift = function (data) {
    return Axios.post(`/tzGift/selectTzGift`,data)
}
//删除礼品
export const tzGiftUpdateStatus = function (id) {
    return Axios.get(`/tzGift/updateStatus?id=${id}`)
}
//新增礼品
export const tzGiftInsert = function (data) {
    return Axios.post(`/tzGift/insert`,data)
}
//礼品详情
export const tzGiftSelectOne = function (id) {
    return Axios.get(`/tzGift/selectOne?id=${id}`)
}
//礼品修改
export const tzGiftUpdateTzGift = function (data) {
    return Axios.post(`/tzGift/updateTzGift`,data)
}
//生产岗位列表
export const menuGetProductionList = function (id) {
    return Axios.get(`/menu/getProductionList`)
}



